package leetcode;

/**
 * @Description 数组异或操作
 * @Author away
 * @Version V1.0.0
 * @Since 1.0
 * @Date 21.5.7
 */

public class T1486 {
    public static void main(String[] args) {
        T1486 t1486 = new T1486();
        int n = 7;
        int start = 0 ;
        int result = t1486.xorOperation(n, start);
        System.out.println();
    }
    public int xorOperation(int n, int start) {
        int result = start;
        for (int i = 1; i <n ; i++) {
            result ^= (start + i * 2);
        }
        return result ;
    }
}
